# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rogue-mysql-server
pkgver=2.78ebbfc
pkgrel=3
pkgdesc='A rogue MySQL server written in Python.'
groups=('blackarch' 'blackarch-misc')
arch=('any')
url='https://github.com/Gifts/Rogue-MySql-Server'
license=('BSD')
depends=('python2')
makedepends=('git')
source=("$pkgname::git+https://github.com/Gifts/Rogue-MySql-Server.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/env python|/env python2|g' rogue_mysql_server.py
}

package() {
  cd $pkgname

  install -Dm 755 rogue_mysql_server.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

